<include file="common/hearder" />

<form method="post">
    <div class="form-group col-xs-12 col-md-5" style="margin-top: 20px">
        <label >员工姓名</label>
        <input type="text" value="{$info.stf_name}" name="stf_name" class="form-control"  placeholder="员工姓名">
        <input type="hidden" value="" name="statuss" class="form-control" >
    </div>
    <div class="form-group col-xs-12 col-md-5" style="margin-top: 20px">
        <label >出生日期</label>
        <a class='input-group date' id='datetimepicker1' >
            <input type='text' class="form-control" id='nowdate' name="stf_brith"  value="{$info.stf_brith}"/>
            <span class="input-group-addon" >
            <span class="glyphicon glyphicon-calendar" onclick="Datetime()"></span>
        </span>
        </a>
    </div>
    <div class="form-group col-xs-12 col-md-12">
        <label >性别</label>
        <div class="am-u-sm-9">
                <input type="radio" name="stf_sex" value="0" {$info['stf_sex'] == 0 ?'checked':''}> 男
                <input type="radio" name="stf_sex" value="1" {$info['stf_sex'] == 1 ?'checked':''}> 女

        </div>
    </div>

    <div class="form-group col-xs-12 col-md-5">
        <label >入职时间</label>
        <a class='input-group date' id='datetimepicker2' >
            <input type='text' class="form-control" id='nowdate2' name="wd_time"  value="{$info.wd_time}"/>
            <span class="input-group-addon" >
            <span class="glyphicon glyphicon-calendar" onclick="Datetime2()"></span>
        </span>
        </a>
    </div>
    <div class="form-group col-xs-12 col-md-5">
        <label >离职时间</label>
        <a class='input-group date' id='datetimepicker3' >
            <input type='text' class="form-control" id='nowdate3' name="rd_time"  value="{$info.rd_time}"/>
            <span class="input-group-addon" >
            <span class="glyphicon glyphicon-calendar" onclick="Datetime3()"></span>
        </span>
        </a>
    </div>
    <div class="form-group col-xs-12 col-md-5">
        <label >员工邮箱</label>
        <input type="email" value="{$info.stf_email}" name="stf_email" class="form-control"  placeholder="员工邮箱">
    </div>
    <div class="form-group col-xs-12 col-md-5">
        <label >员工学历</label>   <label style="color: red">*</label>
        <select name="stf_study" class="form-control" >
            <option>小学</option>
            <option>初中</option>
            <option>高中</option>
            <option>专科</option>
            <option>本科</option>
            <option>其他</option>
        </select>

    </div>
    <div class="form-group col-xs-12 col-md-5">
        <label >联系方式</label>
        <input type="text" value="{$info.stf_phone}" name="stf_phone" class="form-control"  placeholder="联系方式">
    </div>
    <div class="form-group col-xs-12 col-md-5">
        <label >身份证号码</label>
        <input type="text" value="{$info.stf_bank}" name="stf_bank" class="form-control"  placeholder="18位">
    </div>


    <div class="col-xs-12 col-md-8" style="margin-bottom: 20px">
        <input type="hidden" name="stf_id" value="{$info.stf_id}">
        <input type="hidden" name="submit" value="1">
        <button type="submit" class="btn btn-success ">保存修改</button>
        <a class="btn btn-default" href="{:U('staffinfo/index')}">取消</a>
    </div>
</form>
<script>

    $('select[name="dpt_id"]').change(function () {
        var dpt_id=$(this).val();
        $.get('{:U("Staffinfo/api")}?dpt_id='+dpt_id,function (data) {
            var sel="";
            for(var i=0;i<data.length;i++){
                sel+='<option value="'+data[i].pt_id+'">'+data[i].pt_name+'</option>';
            }
            $('select[name="pt_id"]').html(sel);
        });
    });
    function Datetime() {

        $('#datetimepicker1').datetimepicker({
            language: 'zh-CN',//显示中文
            format: 'yyyy-mm-dd',//显示格式
            minView: "month",//设置只显示到月份
            initialDate: new Date(),
            autoclose: true,//选中自动关闭
            todayBtn: true,//显示今日按钮
            locale: moment.locale('zh-cn')
        });
        //默认获取当前日期
        var today = new Date();
        var nowdate = (today.getFullYear()) + "-" + (today.getMonth() + 1) + "-" + today.getDate();
        //对日期格式进行处理
        var date = new Date(nowdate);
        var mon = date.getMonth() + 1;
        var day = date.getDate();
        var mydate = date.getFullYear() + "-" + (mon < 10 ? "0" + mon : mon) + "-" + (day < 10 ? "0" + day : day);
        document.getElementById("nowdate").value = mydate;
    }

    function Datetime2() {
        $('#datetimepicker2').datetimepicker({
            language: 'zh-CN',//显示中文
            format: 'yyyy-mm-dd',//显示格式
            minView: "month",//设置只显示到月份
            initialDate: new Date(),
            autoclose: true,//选中自动关闭
            todayBtn: true,//显示今日按钮
            locale: moment.locale('zh-cn')
        });

        //默认获取当前日期
        var today = new Date();
        var nowdate = (today.getFullYear()) + "-" + (today.getMonth() + 1) + "-" + today.getDate();
        //对日期格式进行处理
        var date = new Date(nowdate);
        var mon = date.getMonth() + 1;
        var day = date.getDate();
        var mydate = date.getFullYear() + "-" + (mon < 10 ? "0" + mon : mon) + "-" + (day < 10 ? "0" + day : day);
        document.getElementById("nowdate2").value = mydate;
    }
    function Datetime3() {
        $('#datetimepicker3').datetimepicker({
            language: 'zh-CN',//显示中文
            format: 'yyyy-mm-dd',//显示格式
            minView: "month",//设置只显示到月份
            initialDate: new Date(),
            autoclose: true,//选中自动关闭
            todayBtn: true,//显示今日按钮
            locale: moment.locale('zh-cn')
        });

        //默认获取当前日期
        var today = new Date();
        var nowdate = (today.getFullYear()) + "-" + (today.getMonth() + 1) + "-" + today.getDate();
        //对日期格式进行处理
        var date = new Date(nowdate);
        var mon = date.getMonth() + 1;
        var day = date.getDate();
        var mydate = date.getFullYear() + "-" + (mon < 10 ? "0" + mon : mon) + "-" + (day < 10 ? "0" + day : day);
        document.getElementById("nowdate3").value = mydate;
    }
</script>
<include file="common/footer"/>